//
//  ViewController.m
//  Browser
//
//  Created by ZHY on 2017/7/11.
//  Copyright © 2017年 ZHY. All rights reserved.
//

#import "ViewController.h"
#import "PhotoBrowserController.h"
#import "PhotoAnimation.h"

@interface ViewController ()

@property (nonatomic,strong) UIButton *btn;
@property (nonatomic,strong) UIImageView  *img;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    self.btn = [UIButton buttonWithType:UIButtonTypeCustom];
    self.btn.backgroundColor = [UIColor redColor];
    [self.btn addTarget:self action:@selector(btnClick) forControlEvents:UIControlEventTouchUpInside];
    self.btn.frame = CGRectMake(50, 50, 50, 50);
    [self.view addSubview:self.btn];
    
    self.img = [[UIImageView alloc] initWithFrame:CGRectMake(50, 200, 50, 50)];
    self.img.image = [UIImage imageNamed:@"1.jpeg"];
    [self.view addSubview:self.img];
    
    
    
}

-(void)btnClick {
    
//    PhotoAnimation *animation = [[PhotoAnimation alloc] init];
//    animation.sourceImageView = self.img;

    

    PhotoBrowserController *vc = [[PhotoBrowserController alloc] init];
    
//    vc.imgs = @[@"1.jpeg",@"2"];
    vc.urls = @[@"https://pic3.zhimg.com/a08d583dabdfc6cd0972587c61573c16_b.jpg"];
//    vc.transitioningDelegate = animation;
    vc.currentIndex = 0;
    [self presentViewController:vc animated:YES completion:nil];
    
}

@end
